import request from '@/utils/request'

export function getapi(current,size) {
    return request({
        url: '/admin/news/getNews',
        method: 'get',
        params: { current, size }
    })
}

export function getNewsById(id) {
    return request({
        url: '/admin/news/getNewsById',
        method: 'get',
        params: { id }
    })
}

export function addapi(data) {
    return request({
        url: '/admin/news/addNews',
        method: 'post',
        data
    })
}

export function updateapi(data) {
    return request({
        url: '/admin/news/updateNews',
        method: 'post',
        data
    })
}

export function deleteapi(id) {
    return request({
        url: '/admin/news/deleteNews',
        method: 'get',
        params: { id }
    })
}